package com.example.xueshen.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import com.example.xueshen.common.dao.SystemUserDao;
import com.example.xueshen.common.entity.SystemUser;
import com.example.xueshen.common.service.SystemUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional
public class SystemUserServiceImpl implements SystemUserService {
    @Resource
    private SystemUserDao systemUserDao;
    @Override
    public SystemUser selectOneByNameAndPassword(SystemUser systemUser) {
        QueryWrapper<SystemUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_name",systemUser.getUserName())
                .eq("password",systemUser.getPassword());
        return systemUserDao.selectOne(queryWrapper);
    }

}
